home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / misc / ImageFXDevKit.lha / sdev / doc / Scan.autodoc < prev   
Encoding:
Text File  |  1993-06-30  |  55.2 KB  |  2,243 lines

  1. TABLE OF CONTENTS
  2.  
  3. scan.library/AllocBuffer
  4. scan.library/AllocChipBitMap
  5. scan.library/AllocFastBitMap
  6. scan.library/ArrangePanel
  7. scan.library/Bar
  8. scan.library/BClose
  9. scan.library/BeginBar
  10. scan.library/BFlush
  11. scan.library/BGetc
  12. scan.library/BGets
  13. scan.library/BOpen
  14. scan.library/BPutc
  15. scan.library/BPuts
  16. scan.library/BRead
  17. scan.library/BSeek
  18. scan.library/BWrite
  19. scan.library/ClearBitMap
  20. scan.library/CloseWindowSafely
  21. scan.library/DeleteBitMap
  22. scan.library/EasyProcess
  23. scan.library/EndBar
  24. scan.library/Error
  25. scan.library/FreeBuffer
  26. scan.library/GetBufLine
  27. scan.library/GetBufLines
  28. scan.library/GetError
  29. scan.library/HidePanel
  30. scan.library/InitBuffer
  31. scan.library/IntegerRequest
  32. scan.library/IsAnimation
  33. scan.library/KillBuffer
  34. scan.library/mixer
  35. scan.library/NewGetFile
  36. scan.library/NumberRequest
  37. scan.library/ObtainBuffer
  38. scan.library/ParseCommand
  39. scan.library/PutBufLine
  40. scan.library/PutBufLines
  41. scan.library/PutNewBufLine
  42. scan.library/ReadBuffer
  43. scan.library/RedrawArea
  44. scan.library/RedrawFull
  45. scan.library/ReleaseBuffer
  46. scan.library/ReplaceBuffer
  47. scan.library/SaveBrush
  48. scan.library/SaveMapped
  49. scan.library/SaveUndo
  50. scan.library/SetError
  51. scan.library/ShowPanel
  52. scan.library/ShowStatus
  53. scan.library/StringRequest
  54. scan.library/TogglePanel
  55. scan.library/VBoolRequest
  56. scan.library/VErrorf
  57. scan.library/VInfoRequest
  58. scan.library/zzzzzz
  59.  
  60.  
  61.  
  62. scan.library/AllocBuffer
  63.  
  64.     NAME
  65.         AllocBuffer - Allocate and initialize a Buffer structure.
  66.  
  67.     SYNOPSIS
  68.         buffer = AllocBuffer ( name, width, height, depth, bits, flags );
  69.         D0.L                   A0    D0.W   D1.W    D2.W   D3.W  D4.W
  70.  
  71.         struct Buffer *AllocBuffer ( char *, short, short, short,
  72.                                      short, short );
  73.  
  74.     FUNCTION
  75.         Allocate a Buffer structure, complete with image data planes.
  76.         Initializes the structure to suitable default values.
  77.  
  78.     INPUTS
  79.         name -- Name of buffer.  Currently ignored.  Use NULL.
  80.  
  81.         width -- Width of buffer in pixels.
  82.  
  83.         height -- Height of buffer in pixels.
  84.  
  85.         depth -- Depth of buffer in 8-bit planes, use 1 for a greyscale
  86.             buffer or 3 for a color buffer.
  87.  
  88.         bits -- Number of bits per plane.  Always use 8.
  89.  
  90.         flags -- Flag bits.  Set one or more of the following:
  91.  
  92.                     BUFF_DISK   - force buffer to be created on disk.
  93.                                   (use only if you know what you're doing.)
  94.                     BUFF_BRUSH  - buffer is really a brush.
  95.                                   (rarely, if ever, needed.)
  96.                     BUFF_NOVMEM - should not use virtual memory for the buffer.
  97.                                   (try to avoid this one.)
  98.  
  99.                   More often than not, you will simply want to use
  100.                   a flags value of 0.  If the buffer is too large to
  101.                   fit in memory, the user will be asked if he wants
  102.                   to use virtual memory, in which case the buffer will
  103.                   be created on disk anyway.
  104.  
  105.     RESULT
  106.         buffer --- Pointer to a properly filled-in Buffer structure,
  107.             with allocated image data space.  NULL on failure,
  108.             with a secondary result code set in the global
  109.             error.
  110.  
  111.     EXAMPLE
  112.  
  113.     NOTES
  114.         DO NOT ASSUME THE IMAGE DATA IS CLEARED!!
  115.  
  116.     BUGS
  117.  
  118.     SEE ALSO
  119.         scan.library/KillBuffer,scan/buf.h
  120.  
  121.  
  122. scan.library/AllocChipBitMap                     scan.library/AllocChipBitMap
  123.  
  124.     NAME
  125.         AllocChipBitMap -- Allocate a bitmap from chip memory.
  126.  
  127.     SYNOPSIS
  128.         bitmap = AllocChipBitMap ( width, height, depth );
  129.         D0.L                       D0.L   D1.L    D2.L
  130.  
  131.         struct BitMap *AllocChipBitMap ( int, int, int );
  132.  
  133.     FUNCTION
  134.         Allocate a BitMap structure and bitplanes from chip memory, suitable
  135.         for use on an Amiga display.  The bitplanes are cleared.
  136.  
  137.     INPUTS
  138.         width -- Width of the bitmap in pixels.
  139.  
  140.         height -- Height of the bitmap in pixels.
  141.  
  142.         depth -- Depth of bitmap in planes.
  143.  
  144.     RESULTS
  145.         bitmap -- Pointer to an initialized BitMap structure, ready for use.
  146.  
  147.     EXAMPLE
  148.  
  149.     NOTES
  150.         Uses the new graphics.library AllocBitMap() function under V39.
  151.  
  152.     BUGS
  153.  
  154.     SEE ALSO
  155.         scan.library/AllocFastBitMap,scan.library/DeleteBitMap
  156.  
  157.  
  158. scan.library/AllocFastBitMap                     scan.library/AllocFastBitMap
  159.  
  160.     NAME
  161.         AllocFastBitMap -- Allocate a bitmap from fast memory.
  162.  
  163.     SYNOPSIS
  164.         bitmap = AllocFastBitMap ( width, height, depth );
  165.         D0.L                       D0.L   D1.L    D2.L
  166.  
  167.         struct BitMap *AllocFastBitMap ( int, int, int );
  168.  
  169.     FUNCTION
  170.         Allocate a BitMap structure and bitplanes from fast memory.
  171.         The bitplanes are cleared.
  172.  
  173.     INPUTS
  174.         width -- Width of the bitmap in pixels.
  175.  
  176.         height -- Height of the bitmap in pixels.
  177.  
  178.         depth -- Depth of bitmap in planes.
  179.  
  180.     RESULTS
  181.         bitmap -- Pointer to an initialized BitMap structure, ready for use.
  182.  
  183.     EXAMPLE
  184.  
  185.     NOTES
  186.         Uses the new graphics.library AllocBitMap() function under V39.
  187.  
  188.     BUGS
  189.  
  190.     SEE ALSO
  191.         scan.library/AllocFastBitMap,scan.library/DeleteBitMap
  192.  
  193.  
  194. scan.library/ArrangePanel                           scan.library/ArrangePanel
  195.  
  196.     NAME
  197.         ArrangePanel -- Arrange the ImageFX screens properly.
  198.  
  199.     SYNOPSIS
  200.         ArrangePanel ()
  201.  
  202.         void ArrangePanel ( void );
  203.  
  204.     FUNCTION
  205.         Arrange all of the screens that ImageFX uses such that they are
  206.         displayed properly.  Normally one would call this function right after
  207.         opening a screen of your own, so that the menu and possibly the
  208.         palette screens are shown over the bottom properly.  You should always
  209.         call this function instead of doing it yourself, for various reasons.
  210.  
  211.         Note however, that under V39, any screens you open yourself will
  212.         always appear in front of all ImageFX screens, unless you take
  213.         steps to attach the new screen to the ImageFX screens, like this:
  214.  
  215.            YourScreen = OpenScreenTags(NULL,
  216.                                        SA_Parent, ScanBase->sb_vScreen,
  217.                                        ....
  218.                                        TAG_END);
  219.            ArrangePanel();
  220.  
  221.     INPUTS
  222.         None.
  223.  
  224.     RESULTS
  225.         None.
  226.  
  227.     EXAMPLE
  228.  
  229.     NOTES
  230.  
  231.     BUGS
  232.  
  233.     SEE ALSO
  234.  
  235.  
  236. scan.library/Bar
  237.  
  238.     NAME
  239.         Bar - Increment status bar display.
  240.  
  241.     SYNOPSIS
  242.         cancelled = Bar ( iteration );
  243.         D0.L              D0.L
  244.  
  245.         int Bar ( int );
  246.  
  247.     FUNCTION
  248.         Calculates the status bar scale to show the given iteration
  249.         count.
  250.  
  251.     INPUTS
  252.         iteration -- The current iteration of the operation.  For
  253.             example, while loading a file you would call
  254.             Bar() for each scanline and pass the line number.
  255.  
  256.     RESULT
  257.         cancelled -- If you specified that there should be a Cancel
  258.             gadget with the BeginBar() function, then if
  259.             the user clicks that Cancel you will get a
  260.             non-zero result from Bar().  Otherwise, a
  261.             zero result means to continue the operation.
  262.  
  263.     EXAMPLE
  264.         BeginBar ("Chugging", 57, TRUE);
  265.         for (i = 0; i < 57; i++) {
  266.             if (Bar(i)) {
  267.                 Errorf ("You dope, you cancelled me!");
  268.                 break;
  269.             }
  270.             /* perform some calculation here */
  271.         }
  272.         EndBar(NULL);
  273.  
  274.     NOTES
  275.  
  276.     BUGS
  277.  
  278.     SEE ALSO
  279.         scan.library/BeginBar,scan.library/EndBar
  280.  
  281.  
  282. scan.library/BClose                                       scan.library/BClose
  283.  
  284.     NAME
  285.         BClose -- Close a buffered file.
  286.  
  287.     SYNOPSIS
  288.         BClose ( handle );
  289.                  A0
  290.  
  291.         void BClose ( struct BIO * );
  292.  
  293.     FUNCTION
  294.         Closes a buffered file previously opened with BOpen.
  295.  
  296.     INPUTS
  297.         handle -- file handle as returned by BOpen.
  298.  
  299.     RESULTS
  300.         None.
  301.  
  302.     EXAMPLE
  303.  
  304.     NOTES
  305.  
  306.     BUGS
  307.  
  308.     SEE ALSO
  309.         scan.library/BOpen
  310.  
  311.  
  312. scan.library/BeginBar
  313.  
  314.     NAME
  315.         BeginBar - Start a status bar operation.
  316.  
  317.     SYNOPSIS
  318.         BeginBar ( title, maxvalue, abortable );
  319.                    A0     D0.L      D1.L
  320.  
  321.         void BeginBar (char *, int, BOOL)
  322.  
  323.     FUNCTION
  324.         Initializes the status bar in preparation for a long operation.
  325.         Also displays the busy pointer, and prevents the user from
  326.         selecting gadgets on the menu panel.  Note that you MUST call
  327.         EndBar() to get back to normal operations; if you exit without
  328.         calling EndBar(), the user will not be able to do anything as
  329.         all the gadget input will be locked.
  330.  
  331.     INPUTS
  332.         title -- The title to display for the operation.  This
  333.             should be kepts as short as possible (10 characters
  334.             or so), as there is not a lot of room to display this.
  335.  
  336.         maxvalue -- The total number of iterations expected in the
  337.             operation.  For example, if you were loading a
  338.             file you would place the expected number of rows here.
  339.  
  340.         abortable -- If TRUE, a Cancel gadget will be presented to
  341.             the user.  Otherwise, the operation is non-stoppable.
  342.  
  343.     RESULT
  344.         None.
  345.  
  346.     EXAMPLE
  347.         See scan.library/Bar.
  348.  
  349.     NOTES
  350.  
  351.     BUGS
  352.  
  353.     SEE ALSO
  354.         scan.library/Bar,scan.library/EndBar
  355.  
  356.  
  357. scan.library/BFlush                                       scan.library/BFlush
  358.  
  359.     NAME
  360.         BFlush -- Flush current buffer to disk.
  361.  
  362.     SYNOPSIS
  363.         BFlush ( handle );
  364.                  A0
  365.  
  366.         void BFlush ( struct BIO * );
  367.  
  368.     FUNCTION
  369.         For a MODE_NEWFILE buffered file, flush the contents of the buffer to
  370.         disk.  For a read file, this function does nothing.
  371.  
  372.     INPUTS
  373.         handle -- file handle as returned by BOpen.
  374.  
  375.     RESULTS
  376.         None.
  377.  
  378.     EXAMPLE
  379.  
  380.     NOTES
  381.  
  382.     BUGS
  383.  
  384.     SEE ALSO
  385.  
  386.  
  387. scan.library/BGetc                                         scan.library/BGetc
  388.  
  389.     NAME
  390.         BGetc -- Read a character from buffered file.
  391.  
  392.     SYNOPSIS
  393.         character = BGetc ( handle );
  394.         D0.L                A0
  395.  
  396.         int BGetc ( struct BIO * );
  397.  
  398.     FUNCTION
  399.         Read the next available character from the given buffered file.  The
  400.         file handle must have been opened by BOpen as MODE_OLDFILE.
  401.  
  402.     INPUTS
  403.         handle -- file handle as returned by BOpen.
  404.  
  405.     RESULTS
  406.         character -- character that was read, or -1 on failure (eg. disk
  407.             error).
  408.  
  409.     EXAMPLE
  410.  
  411.     NOTES
  412.  
  413.     BUGS
  414.  
  415.     SEE ALSO
  416.  
  417.  
  418. scan.library/BGets                                         scan.library/BGets
  419.  
  420.     NAME
  421.         BGets -- Read a string from a buffered file.
  422.  
  423.     SYNOPSIS
  424.         count = BGets ( handle, buffer, maxlength );
  425.         D0.L            A0      A1      D0.L
  426.  
  427.         int BGets ( struct BIO *, UBYTE *, int );
  428.  
  429.     FUNCTION
  430.         Read from the given buffered file until the next newline.  The newline
  431.         is NOT stripped.  The file handle must have been opened by BOpen as
  432.         MODE_OLDFILE.
  433.  
  434.     INPUTS
  435.         handle -- file handle as returned by BOpen.
  436.  
  437.         buffer -- buffer into which to read the characters.
  438.  
  439.         maxlength -- maximum number of characters to read.
  440.  
  441.     RESULTS
  442.         count -- number of characters actually read.
  443.  
  444.     EXAMPLE
  445.  
  446.     NOTES
  447.  
  448.     BUGS
  449.  
  450.     SEE ALSO
  451.  
  452.  
  453. scan.library/BOpen                                         scan.library/BOpen
  454.  
  455.     NAME
  456.         BOpen -- Open a file for buffered reading or writing.
  457.  
  458.     SYNOPSIS
  459.         handle = BOpen ( filename, accessmode, bufsize );
  460.         D0.L             A0        D0.L        D1.L
  461.  
  462.         struct BIO *BOpen ( char *, ULONG, ULONG );
  463.  
  464.     FUNCTION
  465.         Open a file for buffered access.
  466.  
  467.     INPUTS
  468.         filename -- name of file to open.
  469.  
  470.         accessmode -- MODE_OLDFILE for reading or MODE_NEWFILE for writing.
  471.  
  472.         bufsize -- size of buffer for reading or writing.  If 0, then a
  473.             default value will be used.
  474.  
  475.     RESULTS
  476.         handle -- handle for subsequent access.  Do not attempt to examine the
  477.             contents of this structure.
  478.  
  479.     EXAMPLE
  480.  
  481.     NOTES
  482.  
  483.     BUGS
  484.  
  485.     SEE ALSO
  486.         scan.library/BClose
  487.  
  488.  
  489. scan.library/BPutc                                         scan.library/BPutc
  490.  
  491.     NAME
  492.         BPutc -- Write a character to buffered file.
  493.  
  494.     SYNOPSIS
  495.         success = BPutc ( handle, character );
  496.         D0.L              A0      D0.B
  497.  
  498.     FUNCTION
  499.         Write a single (unsigned) character to the given buffered file.  The
  500.         file handle must have been opened by BOpen as MODE_NEWFILE.
  501.  
  502.     INPUTS
  503.         handle -- file handle as returned by BOpen.
  504.  
  505.         character -- byte to write to the file.
  506.  
  507.     RESULTS
  508.         success -- TRUE if the character was sucessfully written, or FALSE if
  509.             something went wrong (eg. disk error).
  510.  
  511.     EXAMPLE
  512.  
  513.     NOTES
  514.  
  515.     BUGS
  516.  
  517.     SEE ALSO
  518.  
  519.  
  520. scan.library/BPuts                                         scan.library/BPuts
  521.  
  522.     NAME
  523.         BPuts -- Write a string to a buffered file.
  524.  
  525.     SYNOPSIS
  526.         success = BPuts ( handle, string );
  527.         D0.L              A0      A1
  528.  
  529.         BOOL BPuts ( struct BIO *, UBYTE * );
  530.  
  531.     FUNCTION
  532.         Write a null-terminated string to the given buffered file.  The
  533.         file handle must have been opened by BOpen as MODE_NEWFILE.  A newline
  534.         will be appended to the string when written to the file.
  535.  
  536.     INPUTS
  537.         handle -- file handle as returned by BOpen.
  538.  
  539.         string -- null-terminated string to write to the file.  A newline will
  540.             be appended.
  541.  
  542.     RESULTS
  543.         success -- TRUE if the string was sucessfully written, or FALSE if
  544.             something went wrong (eg. disk error).
  545.  
  546.     EXAMPLE
  547.  
  548.     NOTES
  549.  
  550.     BUGS
  551.  
  552.     SEE ALSO
  553.  
  554.  
  555. scan.library/BRead                                         scan.library/BRead
  556.  
  557.     NAME
  558.         BRead -- Read a block of characters from a buffered file.
  559.  
  560.     SYNOPSIS
  561.         count = BRead ( handle, buffer, length );
  562.         D0.L            A0      A1      D0.L
  563.  
  564.         int BRead ( struct BIO *, UBYTE *, int );
  565.  
  566.     FUNCTION
  567.         Read a fixed number of characters from a buffered file.  The
  568.         file handle must have been opened by BOpen as MODE_OLDFILE.
  569.  
  570.     INPUTS
  571.         handle -- file handle as returned by BOpen.
  572.  
  573.         buffer -- pointer to where to store read characters.
  574.  
  575.         length -- number of characters to read.
  576.  
  577.     RESULTS
  578.         count -- number of characters actually read from the file, or -1 on
  579.             failure (eg. disk error).
  580.  
  581.     EXAMPLE
  582.  
  583.     NOTES
  584.  
  585.     BUGS
  586.  
  587.     SEE ALSO
  588.  
  589.  
  590. scan.library/BSeek                                         scan.library/BSeek
  591.  
  592.     NAME
  593.         BSeek -- Seek to a file position within a buffered file.
  594.  
  595.     SYNOPSIS
  596.         oldposition = BSeek ( handle, offset, from );
  597.         D0.L                  A0      D0.L    D1.L
  598.  
  599.         int BSeek ( struct BIO *, int, int );
  600.  
  601.     FUNCTION
  602.         Seek to a specific file position in a way compatible with buffered
  603.         files.
  604.  
  605.     INPUTS
  606.         handle -- file handle as returned by BOpen.
  607.  
  608.         offset -- new file position.
  609.  
  610.         from -- where to seek from, OFFSET_BEGINNING, OFFSET_CURRENT, or
  611.             OFFSET_END.
  612.  
  613.     RESULTS
  614.         oldposition -- previous file position.
  615.  
  616.     EXAMPLE
  617.  
  618.     NOTES
  619.  
  620.     BUGS
  621.  
  622.     SEE ALSO
  623.  
  624.  
  625. scan.library/BWrite                                       scan.library/BWrite
  626.  
  627.     NAME
  628.         BWrite -- Write a block of characters to a buffered file.
  629.  
  630.     SYNOPSIS
  631.         count = BWrite ( handle, buffer, length );
  632.         D0.L             A0      A1      D0.L
  633.  
  634.         int BWrite ( struct BIO *, UBYTE *, int );
  635.  
  636.     FUNCTION
  637.         Write a fixed number of characters to a buffered file.  The
  638.         file handle must have been opened by BOpen as MODE_NEWFILE.
  639.  
  640.     INPUTS
  641.         handle -- file handle as returned by BOpen.
  642.  
  643.         buffer -- pointer to characters to write.
  644.  
  645.         length -- number of characters to write.
  646.  
  647.     RESULTS
  648.         count -- number of characters actually written to the file, or -1 on
  649.             failure (eg. disk error).
  650.  
  651.     EXAMPLE
  652.  
  653.     NOTES
  654.  
  655.     BUGS
  656.  
  657.     SEE ALSO
  658.  
  659.  
  660. scan.library/ClearBitMap                             scan.library/ClearBitMap
  661.  
  662.     NAME
  663.         ClearBitMap -- Clear the contents of a BitMap.
  664.  
  665.     SYNOPSIS
  666.         ClearBitMap ( bitmap );
  667.                       A0
  668.  
  669.         void ClearBitMap ( struct BitMap * );
  670.  
  671.     FUNCTION
  672.         Clears the bitplane memory of the given bitmap.  The bitplanes may be
  673.         in chip memory or fast memory.
  674.  
  675.     INPUTS
  676.         bitmap -- pointer to a BitMap structure.
  677.  
  678.     RESULTS
  679.         None.
  680.  
  681.     EXAMPLE
  682.  
  683.     NOTES
  684.  
  685.     BUGS
  686.  
  687.     SEE ALSO
  688.  
  689.  
  690. scan.library/CloseWindowSafely                 scan.library/CloseWindowSafely
  691.  
  692.     NAME
  693.         CloseWindowSafely -- Safely close a shared IDCMP window.
  694.  
  695.     SYNOPSIS
  696.         CloseWindowSafely ( window );
  697.                             A0
  698.  
  699.         void CloseWindowSafely ( struct Window *window );
  700.  
  701.     FUNCTION
  702.         If you open a window that share's ImageFX main IDCMP, you should
  703.         use this function to close the window or else risk fireworks.
  704.  
  705.     INPUTS
  706.         window -- pointer to Window to close.
  707.  
  708.     RESULTS
  709.         None.
  710.  
  711.     EXAMPLE
  712.  
  713.     NOTES
  714.  
  715.     BUGS
  716.  
  717.     SEE ALSO
  718.  
  719.  
  720. scan.library/DeleteBitMap                           scan.library/DeleteBitMap
  721.  
  722.     NAME
  723.         DeleteBitMap -- Deallocate a bitmap structure.
  724.  
  725.     SYNOPSIS
  726.         DeleteBitMap ( bitmap );
  727.                        A0
  728.  
  729.         void DeleteBitMap ( struct BitMap * );
  730.  
  731.     FUNCTION
  732.         Frees the bitplane memory and BitMap structure of the given bitmap.
  733.         Dimensions of the bitmap are obtained from the BitMap structure
  734.         itself.  Only use this function on BitMaps obtained with the
  735.         AllocChipBitMap() or AllocFastBitMap() functions.
  736.  
  737.     INPUTS
  738.         bitmap -- pointer to BitMap to free.
  739.  
  740.     RESULTS
  741.         None.
  742.  
  743.     EXAMPLE
  744.  
  745.     NOTES
  746.         Uses the new graphics.library FreeBitMap() function under V39.
  747.  
  748.     BUGS
  749.  
  750.     SEE ALSO
  751.  
  752.  
  753. scan.library/EasyProcess                             scan.library/EasyProcess
  754.  
  755.     NAME
  756.         EasyProcess -- Perform a simple 1:1 effect on an ImageFX buffer.
  757.  
  758.     SYNOPSIS
  759.         success = EasyProcess ( title, color_callback, grey_callback );
  760.         D0.L                    A0     A1              A2
  761.  
  762.         BOOL EasyProcess ( char *, void (*color_callback)(),
  763.                             void (*grey_callback)() );
  764.  
  765.     FUNCTION
  766.         Perform a simple affect on the user's currently selected region (main
  767.         buffer, brush, or region thereof).  Regional information, feathering,
  768.         and other factors will affect the operation.  You should try to use
  769.         this function if possible, as it does a great deal of work for you.
  770.  
  771.     INPUTS
  772.         title -- title to place in status bar while in progress.
  773.  
  774.         color_callback -- callback function which actually modifies color
  775.             pixels.  It's prototype is:
  776.  
  777.                 void color_callback (UBYTE *redptr, UBYTE *grnptr,
  778.                                      UBYTE *bluptr, short x, short y);
  779.  
  780.             Where:
  781.                 redptr -- pointer to current red pixel to be modified.
  782.                 grnptr -- pointer to current green pixel to be modified.
  783.                 bluptr -- pointer to current blue pixel to be modified.
  784.                 x -- current horizontal pixel location.
  785.                 y -- current vertical pixel location.
  786.  
  787.         grey_callback -- callback function which actually modifies grey
  788.             pixels.  It's prototype is:
  789.  
  790.                 void grey_callback (UBYTE *greyptr, short x, short y);
  791.  
  792.             Where:
  793.                 greyptr -- pointer to current grey pixel to be modified.
  794.                 x -- current horizontal pixel location.
  795.                 y -- current vertical pixel location.
  796.  
  797.             Arguments are passed on the stack.  You must make sure to restore
  798.             A4 in your callback functions if you are using small data model!
  799.  
  800.             EasyProcess() will decide whether to use the color or greyscale
  801.             callback function, based on the image it is working on.
  802.  
  803.     RESULTS
  804.         success -- TRUE if the process was successful, FALSE on failure.
  805.  
  806.     EXAMPLE
  807.         /* A simple color negative effect */
  808.  
  809.         void __saveds colorback (UBYTE *r, UBYTE *g, UBYTE *b,
  810.                                  short x, short y)
  811.         {
  812.             *r = 255 - *r;
  813.             *g = 255 - *g;
  814.             *b = 255 - *b;
  815.         }
  816.  
  817.         void __saveds greyback (UBYTE *g, short x, short y)
  818.         {
  819.             *g = 255 - *g;
  820.         }
  821.  
  822.         void DoEffect (void)
  823.         {
  824.             EasyProcess("Negative", colorback, greyback);
  825.         }
  826.  
  827.     NOTES
  828.         This should not be used to do geometric or translational effects on a
  829.         buffer (ie. where pixel positions are moved).  This is only good for
  830.         doing simple color effects.
  831.  
  832.     BUGS
  833.  
  834.     SEE ALSO
  835.  
  836.  
  837. scan.library/EndBar
  838.  
  839.     NAME
  840.         EndBar - End a status bar operation.
  841.  
  842.     SYNOPSIS
  843.         EndBar ( dummy );
  844.  
  845.         void EndBar (void *);
  846.  
  847.     FUNCTION
  848.         This cleans up and ends a status bar operation.  It clears
  849.         the busy pointer and allows the user to select gadgets in the
  850.         menu panel again.
  851.  
  852.     INPUTS
  853.         None, really.  There used to be an argument, but it has been
  854.         removed.  You should pass NULL as the argument.
  855.  
  856.     RESULT
  857.         None.
  858.  
  859.     EXAMPLE
  860.         See scan.library/Bar.
  861.  
  862.     NOTES
  863.  
  864.     BUGS
  865.         None known.
  866.  
  867.     SEE ALSO
  868.         scan.library/BeginBar,scan.library/Bar
  869.  
  870.  
  871. scan.library/Error
  872.  
  873.     NAME
  874.         Error - Show error message for last generated error.
  875.  
  876.     SYNOPSIS
  877.         Error ();
  878.  
  879.         void Error ( void );
  880.  
  881.     FUNCTION
  882.         Will display a requester to the user showing the text for
  883.         the last error generated.  This function does not return
  884.         until the user clicks Okay.
  885.  
  886.     INPUTS
  887.         None.
  888.  
  889.     RESULT
  890.         None.
  891.  
  892.     EXAMPLE
  893.  
  894.         buffer = AllocBuffer (NULL, 320, 200, 1, 8, 0);
  895.         if (buffer == NULL) {   /* can't get buffer? */
  896.             Error();            /* tell what happend */
  897.             return;
  898.         }
  899.  
  900.     NOTES
  901.  
  902.     BUGS
  903.  
  904.     SEE ALSO
  905.         scan.library/Errorf,scan.library/SetError
  906.  
  907.  
  908. scan.library/FreeBuffer                               scan.library/FreeBuffer
  909.  
  910.     NAME
  911.         FreeBuffer -- Free ImageFX's main buffer.
  912.  
  913.     SYNOPSIS
  914.         FreeBuffer ();
  915.  
  916.         void FreeBuffer ( void );
  917.  
  918.     FUNCTION
  919.         Frees the current main buffer, by calling KillBuffer().
  920.  
  921.     INPUTS
  922.         None.
  923.  
  924.     RESULTS
  925.         None.
  926.  
  927.     EXAMPLE
  928.  
  929.     NOTES
  930.  
  931.     BUGS
  932.  
  933.     SEE ALSO
  934.  
  935.  
  936. scan.library/GetBufLine
  937.  
  938.     NAME
  939.         GetBufLine - Get pointer(s) to a Buffer scanline.
  940.  
  941.     SYNOPSIS
  942.         success = GetBufLine ( buffer, redptr, grnptr, bluptr, row );
  943.         D0.L                   A0      A1      A2      A3      D0.W
  944.  
  945.         int GetBufLine ( struct Buffer *, UBYTE **, UBYTE **, UBYTE **,
  946.                          short );
  947.  
  948.     FUNCTION
  949.         Fills in the supplied pointers with pointers to the image data
  950.         for a Buffer.  You should ONLY reference a buffer by using
  951.         this function, as there is more work than meets the eye for
  952.         a buffer maintained on disk.
  953.  
  954.     INPUTS
  955.         buffer -- Pointer to a Buffer obtained via. ObtainBuffer().
  956.  
  957.         redptr -- Where to store Red scanline pointer.
  958.  
  959.         grnptr -- Where to store Green scanline pointer.
  960.  
  961.         bluptr -- Where to store Blue scanline pointer.
  962.  
  963.         row -- Which scanline to retreive, starting from 0 at the
  964.             topmost scanline.
  965.  
  966.     RESULT
  967.         success -- Non-zero if the command was successful.  It can
  968.             only fail if the buffer is maintained on disk and
  969.             enough memory cannot be allocated to read the
  970.             scanline.  A rare occurance, but one worth checking for.
  971.  
  972.     EXAMPLE
  973.  
  974.     NOTES
  975.         For a greyscale buffer, "grnptr" and "bluptr" are set
  976.         to point to the same data as "redptr".
  977.  
  978.         PAY ATTENTION TO THE RETURN VALUE!!  Failing to gracefully
  979.         handle a GetBufLine failure can cause serious problems.
  980.  
  981.     BUGS
  982.  
  983.     SEE ALSO
  984.         scan.library/PutBufLine,scan.library/PutNewBufLine
  985.  
  986.  
  987. scan.library/GetBufLines                             scan.library/GetBufLines
  988.  
  989.     NAME
  990.         GetBufLines -- Get multiple buffer scanlines at once.
  991.  
  992.     SYNOPSIS
  993.         success = GetBufLines ( buffer, rptr, gptr, bptr, top, rows );
  994.         D0.L                    A0      A1    A2    A3    D0.L D1.L
  995.  
  996.         int GetBufLines ( struct Buffer *buffer,
  997.                           UBYTE **rptr, UBYTE **gptr, UBYTE **bptr,
  998.                           short top, short rows );
  999.  
  1000.     FUNCTION
  1001.         Fills in the supplied pointers with pointers to a "chunk" of an
  1002.         image, consisting of more than one scanline.  This is handy for
  1003.         convolution-style operations.  You should try to use this
  1004.         whenever possible when you need two or more adjacent scanlines,
  1005.         as it is somewhat faster than multiple GetBufLine()'s.
  1006.  
  1007.     INPUTS
  1008.         buffer -- Pointer to a Buffer obtained via. ObtainBuffer().
  1009.  
  1010.         redptr -- Where to store Red scanline pointer.
  1011.  
  1012.         grnptr -- Where to store Green scanline pointer.
  1013.  
  1014.         bluptr -- Where to store Blue scanline pointer.
  1015.  
  1016.         top -- Topmost scanline to retreive, starting from 0 at the
  1017.             topmost scanline.
  1018.  
  1019.         rows -- Number of scanlines to retreive.
  1020.  
  1021.     RESULTS
  1022.         success -- non-zero if successful, or zero on failure.
  1023.  
  1024.     EXAMPLE
  1025.  
  1026.     NOTES
  1027.         It *is* possible to, for example, grab a topedge of -1 and a
  1028.         row count of 3 (ie. go out of bounds of the image), but the
  1029.         image data outside the area of the image will be undefined.
  1030.  
  1031.     BUGS
  1032.  
  1033.     SEE ALSO
  1034.  
  1035.  
  1036. scan.library/GetError                                   scan.library/GetError
  1037.  
  1038.     NAME
  1039.         GetError -- Retreive secondary error code.
  1040.  
  1041.     SYNOPSIS
  1042.         error = GetError ();
  1043.         D0.L
  1044.  
  1045.         ULONG GetError ( void );
  1046.  
  1047.     FUNCTION
  1048.         Returns the current secondary error code, as set by a previous call to
  1049.         SetError().
  1050.  
  1051.     INPUTS
  1052.         None.
  1053.  
  1054.     RESULTS
  1055.         error -- current error code.  See "scan/errors.h".
  1056.  
  1057.     EXAMPLE
  1058.  
  1059.     NOTES
  1060.  
  1061.     BUGS
  1062.  
  1063.     SEE ALSO
  1064.  
  1065.  
  1066. scan.library/HidePanel                                 scan.library/HidePanel
  1067.  
  1068.     NAME
  1069.         HidePanel -- Push the menu screen to the back.
  1070.  
  1071.     SYNOPSIS
  1072.         HidePanel ()
  1073.  
  1074.         void HidePanel (void);
  1075.  
  1076.     FUNCTION
  1077.         Pushes the menu screen ("panel") to the back, if it is not already
  1078.         hidden.
  1079.  
  1080.     INPUTS
  1081.         None.
  1082.  
  1083.     RESULTS
  1084.         None.
  1085.  
  1086.     EXAMPLE
  1087.  
  1088.     NOTES
  1089.  
  1090.     BUGS
  1091.  
  1092.     SEE ALSO
  1093.         scan.library/ShowPanel,scan.library/TogglePanel
  1094.  
  1095.  
  1096. scan.library/InitBuffer                               scan.library/InitBuffer
  1097.  
  1098.     NAME
  1099.         InitBuffer -- Create ImageFX main buffer.
  1100.  
  1101.     SYNOPSIS
  1102.         InitBuffer ( name, width, height, depth, bits, flags );
  1103.                      A0    D0.W   D1.W    D2.W   D3.W  D4.W
  1104.  
  1105.         void InitBuffer ( char *, short, short, short, short, short );
  1106.  
  1107.     FUNCTION
  1108.         Creates a main image buffer, deleting the old one first if it exists.
  1109.         This function is otherwise identical to AllocBuffer().
  1110.  
  1111.     INPUTS
  1112.         See AllocBuffer().
  1113.  
  1114.     RESULTS
  1115.         None.
  1116.  
  1117.     EXAMPLE
  1118.  
  1119.     NOTES
  1120.         You can tell whether the call was succesful or not by checking the
  1121.         result of GetError(), or by doing an ObtainBuffer(0).
  1122.  
  1123.         DO NOT ASSUME THE IMAGE DATA IS CLEARED!!
  1124.  
  1125.     BUGS
  1126.  
  1127.     SEE ALSO
  1128.  
  1129.  
  1130. scan.library/IntegerRequest                       scan.library/IntegerRequest
  1131.  
  1132.     NAME
  1133.         IntegerRequest -- Present a slider gadget requester to the user.
  1134.  
  1135.     SYNOPSIS
  1136.         result = IntegerRequest ( title, low, high, initial );
  1137.         D0.L                      A0     D0.L D1.L  D2.L
  1138.  
  1139.         LONG IntegerRequest ( char *, LONG, LONG, LONG );
  1140.  
  1141.     FUNCTION
  1142.         Display a requester containing a slider gadget to the user.  The user
  1143.         must select a value or cancel before this function will return.
  1144.  
  1145.     INPUTS
  1146.         title -- Title of the requester.
  1147.  
  1148.         low -- Lowest value that can be selected with the slider.
  1149.  
  1150.         high -- Highest value that can be selected with the slider.
  1151.  
  1152.         initial -- Initial value of the slider.
  1153.  
  1154.     RESULTS
  1155.         result -- value selected by the user.  If the value is less than the
  1156.             lowest possible value, then the user cancelled the requester.
  1157.  
  1158.     EXAMPLE
  1159.         value = IntegerRequest("Pick a number:", -10, 10, 0);
  1160.         if (value < -10) Errorf("Hey, you can't cancel me!");
  1161.  
  1162.     NOTES
  1163.  
  1164.     BUGS
  1165.  
  1166.     SEE ALSO
  1167.  
  1168.  
  1169. scan.library/IsAnimation                             scan.library/IsAnimation
  1170.  
  1171.     NAME
  1172.         IsAnimation -- Determine if a file is an animation (1.50).
  1173.  
  1174.     SYNOPSIS
  1175.         result = IsAnimation ( filename, format );
  1176.         D0.L                   A0        A1
  1177.  
  1178.         int IsAnimation ( char *filename, char *format );
  1179.  
  1180.     FUNCTION
  1181.         Determine if an image file is an animation (has multiple frames)
  1182.         or not.  First finds out the type of file, then returns whether
  1183.         that type of file is capable of multiple frames.
  1184.  
  1185.     INPUTS
  1186.         filename -- name of file to check.
  1187.  
  1188.         format -- NULL to make ImageFX determine the file format,
  1189.             or the name of a file format to force it to check
  1190.             that format.
  1191.  
  1192.     RESULTS
  1193.         result -- non-zero if the file is an animation, zero if it
  1194.             is not.
  1195.  
  1196.     EXAMPLE
  1197.  
  1198.     NOTES
  1199.  
  1200.     BUGS
  1201.  
  1202.     SEE ALSO
  1203.  
  1204.  
  1205. scan.library/KillBuffer
  1206.  
  1207.     NAME
  1208.         KillBuffer - Deallocate a Buffer structure.
  1209.  
  1210.     SYNOPSIS
  1211.         KillBuffer ( buffer );
  1212.                      A0
  1213.  
  1214.         void KillBuffer ( struct Buffer * );
  1215.  
  1216.     FUNCTION
  1217.         Deallocates all the memory used in a Buffer structure,
  1218.         including image data memory, structure memory, and anything
  1219.         in between.  The buffer no longer exists when this function
  1220.         returns.
  1221.  
  1222.     INPUTS
  1223.         buffer -- Pointer to a Buffer structure.
  1224.  
  1225.     RESULT
  1226.         None.
  1227.  
  1228.     EXAMPLE
  1229.  
  1230.     NOTES
  1231.  
  1232.     BUGS
  1233.  
  1234.     SEE ALSO
  1235.         scan.library/AllocBuffer,scan/buf.h
  1236.  
  1237.  
  1238. scan.library/mixer                                         scan.library/mixer
  1239.  
  1240.     NAME
  1241.         mixer -- Mix two color values.
  1242.  
  1243.     SYNOPSIS
  1244.         result = mixer ( oldvalue, newvalue, blend );
  1245.         D0.W             D0.W      D1.W      D2.W
  1246.  
  1247.         short mixer ( short oldvalue, short newvalue, short blend );
  1248.  
  1249.     FUNCTION
  1250.         Mix two color values using a blend percentage.
  1251.  
  1252.     INPUTS
  1253.         oldvalue -- original value (0-255).
  1254.  
  1255.         newvalue -- new value to blend into the old value (0-255).
  1256.  
  1257.         blend -- blend value (0-255) ; higher blend values blend
  1258.             more of the new value into the old value.
  1259.  
  1260.     RESULTS
  1261.         result -- resulting value (0-255).
  1262.  
  1263.     EXAMPLE
  1264.  
  1265.     NOTES
  1266.         This function is handy for alpha channel blending style
  1267.         operations.
  1268.  
  1269.     BUGS
  1270.         None known.
  1271.  
  1272.     SEE ALSO
  1273.  
  1274.  
  1275. scan.library/NewGetFile                               scan.library/NewGetFile
  1276.  
  1277.     NAME
  1278.         NewGetFile -- Open a file requester.
  1279.  
  1280.     SYNOPSIS
  1281.         file = NewGetFile ( fileinfo, title, flags );
  1282.         D0.L                A0        A1     D0.L
  1283.  
  1284.         char *NewGetFile ( struct FileInfo *, char *, ULONG );
  1285.  
  1286.     FUNCTION
  1287.         Present a file requester from which the user may select a file or
  1288.         directory.  Uses the user's preferred file requester (as set in
  1289.         Prefs).
  1290.  
  1291.     INPUTS
  1292.         fileinfo -- pointer to a FileInfo structure, describing how to open
  1293.             the file requester.  You should fill in the following fields (do
  1294.             not touch any others):
  1295.  
  1296.                 Dir:
  1297.                     Directory where file requester should open.
  1298.  
  1299.                 File:
  1300.                     Default filename.
  1301.  
  1302.                 Pattern:
  1303.                     Filename pattern.
  1304.  
  1305.                 Screen:
  1306.                     Pointer to a custom screen on which to open.
  1307.  
  1308.         title -- title of the file requester.
  1309.  
  1310.         flags -- various flags for the file requester.
  1311.  
  1312.                 FI_SAVE:
  1313.                     Set when this requester is a save action.
  1314.  
  1315.                 FI_DIRONLY:
  1316.                     Only allow selection of a directory.
  1317.  
  1318.                 FI_SCREEN:
  1319.                     Force requester to open on the screen specified by
  1320.                     FileInfo.Screen.
  1321.  
  1322.     RESULTS
  1323.         file -- complete path to filename chosen by the user if successful, or
  1324.             FALSE on failure.  The FileInfo structure will also be updated to
  1325.             reflect the user's selection.
  1326.  
  1327.     EXAMPLE
  1328.  
  1329.     NOTES
  1330.  
  1331.     BUGS
  1332.  
  1333.     SEE ALSO
  1334.  
  1335.  
  1336. scan.library/NumberRequest                         scan.library/NumberRequest
  1337.  
  1338.     NAME
  1339.         NumberRequest -- Present an integer gadget requester to the user.
  1340.  
  1341.     SYNOPSIS
  1342.         result = NumberRequest ( title, low, high, initial );
  1343.         D0.L                     A0     D0.L D1.L  D2.L
  1344.  
  1345.         LONG NumberRequest ( char *, LONG, LONG, LONG );
  1346.  
  1347.     FUNCTION
  1348.         Display a requester containing a numeric integer gadget to the user.
  1349.         The user must enter a value or cancel before this function will
  1350.         return.
  1351.  
  1352.     INPUTS
  1353.         title -- Title of the requester.
  1354.  
  1355.         low -- Lowest value that can be selected with the slider (THIS IS
  1356.             CURRENTLY IGNORED except to determine cancelled values).
  1357.  
  1358.         high -- Highest value that can be selected with the slider (THIS IS
  1359.             CURRENTLY IGNORED).
  1360.  
  1361.         initial -- Initial value of the slider.
  1362.  
  1363.     RESULTS
  1364.         result -- value selected by the user.  If the value is less than the
  1365.             lowest possible value, then the user cancelled the requester.
  1366.  
  1367.     EXAMPLE
  1368.         value = NumberRequest("Pick a number:", -10, 10, 0);
  1369.         if (value < -10) Errorf("Hey, you can't cancel me!");
  1370.  
  1371.     NOTES
  1372.  
  1373.     BUGS
  1374.  
  1375.     SEE ALSO
  1376.  
  1377.  
  1378. scan.library/ObtainBuffer
  1379.  
  1380.     NAME
  1381.         ObtainBuffer - Get a pointer to an image Buffer.
  1382.  
  1383.     SYNOPSIS
  1384.         buffer = ObtainBuffer ( which );
  1385.         D0.L                    D0.L
  1386.  
  1387.         struct Buffer *ObtainBuffer ( int );
  1388.  
  1389.     FUNCTION
  1390.         Returns a pointer to one of the image buffers in use
  1391.         within ImageFX.  You should ALWAYS use this function to get
  1392.         at these buffers, as there is special initialization when the
  1393.         buffer is actually maintained on disk.
  1394.  
  1395.     INPUTS
  1396.         which -- Which buffer to get:
  1397.  
  1398.                     0 = Main buffer
  1399.                     1 = Swap buffer
  1400.                     2 = Alpha channel
  1401.                     3 = Undo buffer
  1402.                     4 = Brush buffer
  1403.  
  1404.     RESULT
  1405.         buffer -- A pointer to the Buffer or NULL if it could not
  1406.             be obtained for some reason.  A typical reason for
  1407.             failure is that the given buffer does not exist.
  1408.  
  1409.     EXAMPLE
  1410.  
  1411.     NOTES
  1412.         You don't get a copy of the buffer, you get the actual pointer
  1413.         to the actual buffer, so be careful which fields you play with.
  1414.         A lot of the fields in the Buffer structure are for internal
  1415.         use only.
  1416.  
  1417.         Currently, two tasks can ObtainBuffer() the same buffer and
  1418.         be successful.  This may change in the future.  For now, try
  1419.         not to nest your ObtainBuffer()/ReleaseBuffer() calls.
  1420.  
  1421.         Remember to ReleaseBuffer() the buffer when you are done.
  1422.  
  1423.     BUGS
  1424.         None known.
  1425.  
  1426.     SEE ALSO
  1427.         scan.library/ReleaseBuffer,scan/buf.h
  1428.  
  1429.  
  1430. scan.library/ParseCommand                           scan.library/ParseCommand
  1431.  
  1432.     NAME
  1433.         ParseCommand -- Parse an ImageFX command string.
  1434.  
  1435.     SYNOPSIS
  1436.         result = ParseCommand ( commandstring, message );
  1437.         D0.L                    A0             A1
  1438.  
  1439.         int ParseCommand ( char *, struct RexxMsg * );
  1440.  
  1441.     FUNCTION
  1442.         Passes a string of commands to ImageFX for it to execute.  This
  1443.         function does not return until the commands are completed (or
  1444.         aborted).  The string may contain more than one command if each is
  1445.         separated by a semi-colon (;).
  1446.  
  1447.     INPUTS
  1448.         commandstring -- pointer to string of commands to execute.
  1449.  
  1450.         message -- invoking Arexx message, used to set result codes.  You
  1451.             should pass NULL.
  1452.  
  1453.     RESULTS
  1454.         result -- result code from the commands, 0 for success or non-zero on
  1455.             failure.
  1456.  
  1457.     EXAMPLE
  1458.         ParseCommand("Negative; Swap; Color2Grey Luma", NULL);
  1459.  
  1460.     NOTES
  1461.         See the ImageFX manual chapter on Arexx commands for details of the
  1462.         commands that ImageFX understands.
  1463.  
  1464.     BUGS
  1465.  
  1466.     SEE ALSO
  1467.  
  1468.  
  1469. scan.library/PutBufLine
  1470.  
  1471.     NAME
  1472.         PutBufLine - Restore last scanline read to a Buffer.
  1473.  
  1474.     SYNOPSIS
  1475.         success = PutBufLine ( buffer );
  1476.         D0.L                   A0
  1477.  
  1478.         int PutBufLine ( struct Buffer *buffer );
  1479.  
  1480.     FUNCTION
  1481.         Restores to the given buffer the last scanline read with the
  1482.         GetBufLine() function.  This function must be called if any
  1483.         changes are made to the scanline.  You *MUST* call GetBufLine()
  1484.         before calling this function.
  1485.  
  1486.     INPUTS
  1487.         buffer -- Pointer to a Buffer structure as returned by ObtainBuffer().
  1488.  
  1489.     RESULT
  1490.         success -- Non-zero if successful.
  1491.  
  1492.     EXAMPLE
  1493.         buffer = ObtainBuffer(0);
  1494.         if (buffer) {
  1495.             for (row = 0; row < buffer->Height; row++) {
  1496.                 GetBufLine (buffer, &red, &grn, &blu, row);
  1497.                 /* make some changes to the data */
  1498.                 PutBufLine (buffer);
  1499.             }
  1500.             ReleaseBuffer (buffer);
  1501.         }
  1502.  
  1503.     NOTES
  1504.         Not calling this function after making changes to a scanline will
  1505.         only become apparent when working on disk buffers.
  1506.  
  1507.         PAY ATTENTION TO THE RETURN VALUE!!  Failing to gracefully
  1508.         handle a PutBufLine failure can cause serious problems.
  1509.  
  1510.     BUGS
  1511.  
  1512.     SEE ALSO
  1513.         scan.library/GetBufLine
  1514.  
  1515.  
  1516. scan.library/PutBufLines                             scan.library/PutBufLines
  1517.  
  1518.     NAME
  1519.         PutBufLines -- Restore multiple scanlines to a buffer.
  1520.  
  1521.     SYNOPSIS
  1522.         success = PutBufLines ( buffer, topedge, rows );
  1523.         D0.L                    A0      D0.L     D1.L
  1524.  
  1525.         int PutBufLines ( struct Buffer *buffer, short topedge, short rows );
  1526.  
  1527.     FUNCTION
  1528.         Restore the last batch of scanlines retreived with GetBufLines().
  1529.         The scanline data may be replaced anywhere in the image, but it
  1530.         is generally a good idea to put it back where it came from.
  1531.  
  1532.     INPUTS
  1533.         buffer -- buffer to replace data into (must be the same as where it
  1534.             came from).
  1535.  
  1536.         topedge -- topedge location of where to restore the data (-1 means
  1537.             restore it where it came from).
  1538.  
  1539.         rows -- number of rows of data to restore (-1 means restore the
  1540.             same amount that was gotten).
  1541.  
  1542.     RESULTS
  1543.         success -- non-zero if successful, zero on failure.
  1544.  
  1545.     EXAMPLE
  1546.  
  1547.     NOTES
  1548.  
  1549.     BUGS
  1550.  
  1551.     SEE ALSO
  1552.         scan.library/GetBufLines
  1553.  
  1554.  
  1555. scan.library/PutNewBufLine
  1556.  
  1557.     NAME
  1558.         PutNewBufLine - Store new image data into a buffer scanline.
  1559.  
  1560.     SYNOPSIS
  1561.         success = PutNewBufLine ( buffer, reddata, grndata, bludata, row );
  1562.         D0.L                      A0      A1       A2       A3       D0.W
  1563.  
  1564.         int PutNewBufLine ( struct Buffer *, UBYTE *, UBYTE *, UBYTE *,
  1565.                             short );
  1566.  
  1567.     FUNCTION
  1568.         Stores image data into a buffer at any arbitrary scanline.
  1569.         You do NOT need to call GetBufLine() beforehand.  The image
  1570.         data is copied, so you don't need to hold onto the data.
  1571.  
  1572.     INPUTS
  1573.         buffer -- Buffer structure as returned by ObtainBuffer().
  1574.  
  1575.         reddata -- Pointer to Red image data.
  1576.  
  1577.         grndata -- Pointer to Green image data.
  1578.  
  1579.         bludata -- Pointer to Blue image data.
  1580.  
  1581.         row -- Scanline to store the data, starting from 0.
  1582.  
  1583.     RESULT
  1584.         success -- Non-zero if successful.
  1585.  
  1586.     EXAMPLE
  1587.         buffer = ObtainBuffer(0);
  1588.         if (buffer) {
  1589.             for (row = 0; row < buffer->Height; row += 4) {
  1590.                 /* build a scanline of data */
  1591.                 PutNewBufLine (buffer, red, grn, blu, row);
  1592.             }
  1593.             ReleaseBuffer (buffer);
  1594.         }
  1595.  
  1596.     NOTES
  1597.         This function can only fail if the buffer is maintained on disk
  1598.         and memory could not be obtained to swap the relavant page into
  1599.         memory.
  1600.  
  1601.         When storing to a greyscale buffer, the Red pointer should point
  1602.         to the greyscale data.  The other two pointers are ignored.
  1603.  
  1604.         PAY ATTENTION TO THE RETURN VALUE!!  Failing to gracefully
  1605.         handle a PutNewBufLine failure can cause serious problems.
  1606.  
  1607.     BUGS
  1608.  
  1609.     SEE ALSO
  1610.         scan.library/GetBufLine,scan.library/PutBufLine
  1611.  
  1612.  
  1613. scan.library/ReadBuffer                               scan.library/ReadBuffer
  1614.  
  1615.     NAME
  1616.         ReadBuffer -- Attempt to read an image file from disk.
  1617.  
  1618.     SYNOPSIS
  1619.         buffer = ReadBuffer ( filename, args );
  1620.         D0.L                  A0        A1
  1621.  
  1622.         struct Buffer *ReadBuffer ( char *filename, char *args );
  1623.  
  1624.     FUNCTION
  1625.         Read image data from a disk file into an ImageFX Buffer
  1626.         structure.  ImageFX will automatically figure out the file
  1627.         format and call the appropriate loader.
  1628.  
  1629.     INPUTS
  1630.         filename -- filename of image file to read.
  1631.  
  1632.         args -- argument string to be passed to the loader module
  1633.             that gets called (eg. could be used to specify a frame
  1634.             number for an animation loader).
  1635.  
  1636.     RESULTS
  1637.         buffer -- pointer to a properly filled-in Buffer structure,
  1638.             which can be used in any future operation.
  1639.  
  1640.     EXAMPLE
  1641.  
  1642.     NOTES
  1643.         Remember to KillBuffer() the buffer when you're done with it!
  1644.  
  1645.     BUGS
  1646.  
  1647.     SEE ALSO
  1648.  
  1649.  
  1650. scan.library/RedrawArea                               scan.library/RedrawArea
  1651.  
  1652.     NAME
  1653.         RedrawArea -- Redraw a portion of the main image buffer.
  1654.  
  1655.     SYNOPSIS
  1656.         RedrawArea ( left, top, right, bottom );
  1657.                      D0.L  D1.L D2.L   D3.L
  1658.  
  1659.         void RedrawArea ( int, int, int, int );
  1660.  
  1661.     FUNCTION
  1662.         Redraw only a portion of the current ImageFX main buffer.  If
  1663.         redrawing has been disabled (with the "Redraw Off" command),
  1664.         no update will take place, but the screen will be refreshed when
  1665.         redraw is turned back on.
  1666.  
  1667.         You should call this or the RedrawFull() function after you have made
  1668.         a modification to an image buffer.
  1669.  
  1670.     INPUTS
  1671.         left, top -- upper left corner of the area you want to redraw,
  1672.             measured in pixels.
  1673.  
  1674.         right, bottom -- bottom right corner of the area you want to redraw,
  1675.             measured in pixels.
  1676.  
  1677.     RESULTS
  1678.         None.
  1679.  
  1680.     EXAMPLE
  1681.  
  1682.     NOTES
  1683.  
  1684.     BUGS
  1685.  
  1686.     SEE ALSO
  1687.  
  1688.  
  1689. scan.library/RedrawFull                               scan.library/RedrawFull
  1690.  
  1691.     NAME
  1692.         RedrawFull -- Redraw main image buffer.
  1693.  
  1694.     SYNOPSIS
  1695.         RedrawFull ();
  1696.  
  1697.         void RedrawFull ( void );
  1698.  
  1699.     FUNCTION
  1700.         Redraw the current ImageFX main buffer.  If redrawing has been
  1701.         disabled (with the "Redraw Off" command), no update will take place,
  1702.         but the screen will be refreshed when redraw is turned back on.
  1703.  
  1704.         You should call this or the RedrawArea() function after you have made
  1705.         a modification to an image buffer.
  1706.  
  1707.     INPUTS
  1708.         None.
  1709.  
  1710.     RESULTS
  1711.         None.
  1712.  
  1713.     EXAMPLE
  1714.  
  1715.     NOTES
  1716.  
  1717.     BUGS
  1718.  
  1719.     SEE ALSO
  1720.         scan.library/RedrawArea
  1721.  
  1722.  
  1723. scan.library/ReleaseBuffer
  1724.  
  1725.     NAME
  1726.         ReleaseBuffer - Release a Buffer after you're finished.
  1727.  
  1728.     SYNOPSIS
  1729.         ReleaseBuffer ( buffer );
  1730.                         A0
  1731.  
  1732.         void ReleaseBuffer ( struct Buffer * );
  1733.  
  1734.     FUNCTION
  1735.         Releases a Buffer obtained with ObtainBuffer(), doing any
  1736.         cleanup necessary.  You should ALWAYS call this function
  1737.         when you are done with the Buffer, as there is special
  1738.         cleanup involved if the buffer is maintained on disk.
  1739.  
  1740.     INPUTS
  1741.         buffer -- Pointer to a Buffer structure obtained with
  1742.             the ObtainBuffer() structure.
  1743.  
  1744.     RESULT
  1745.         None.
  1746.  
  1747.     EXAMPLE
  1748.  
  1749.     NOTES
  1750.  
  1751.     BUGS
  1752.  
  1753.     SEE ALSO
  1754.         scan.library/ObtainBuffer,scan/buf.h
  1755.  
  1756.  
  1757. scan.library/ReplaceBuffer                         scan.library/ReplaceBuffer
  1758.  
  1759.     NAME
  1760.         ReplaceBuffer -- Replace the contents of one buffer with another.
  1761.  
  1762.     SYNOPSIS
  1763.         ReplaceBuffer ( oldBuf, newBuf );
  1764.                         A0      A1
  1765.  
  1766.         void ReplaceBuffer ( struct Buffer *, struct Buffer * );
  1767.  
  1768.     FUNCTION
  1769.         Replaces the image data of the old buffer with the image data of the
  1770.         new buffer.  The new buffer is then freed.
  1771.  
  1772.     INPUTS
  1773.         oldBuf -- pointer to Buffer to replace.
  1774.  
  1775.         newBuf -- pointer to Buffer with the image data that is to replace the
  1776.             old buffer.  This buffer will be freed when the function returns.
  1777.  
  1778.     RESULTS
  1779.         None.
  1780.  
  1781.     EXAMPLE
  1782.  
  1783.     NOTES
  1784.  
  1785.     BUGS
  1786.  
  1787.     SEE ALSO
  1788.  
  1789.  
  1790. scan.library/SaveBrush                                 scan.library/SaveBrush
  1791.  
  1792.     NAME
  1793.         SaveBrush -- Save a Buffer structure to disk.
  1794.  
  1795.     SYNOPSIS
  1796.         success = SaveBrush ( buffer, filename, format, args );
  1797.         D0.L                  A0      A1        A2      A3
  1798.  
  1799.         BOOL SaveBrush ( struct Buffer *buffer, char *filename,
  1800.                          char *format, char *args );
  1801.  
  1802.     FUNCTION
  1803.         Save the image data of a Buffer structure to disk using
  1804.         a specified file format.  ImageFX will load and call the
  1805.         appropriate saver module for the file format you specify.
  1806.  
  1807.     INPUTS
  1808.         buffer -- properly initialized Buffer structure to be saved.
  1809.  
  1810.         filename -- filename where image is stored.
  1811.  
  1812.         format -- file format to save in (eg. "ILBM", "ANIM", etc.).
  1813.  
  1814.         args -- argument string to be passed to the saver module
  1815.             that is called (eg. could be used to specify compression
  1816.             options).
  1817.  
  1818.     RESULTS
  1819.         success -- TRUE if the save was successful, or FALSE if it
  1820.             was not.
  1821.  
  1822.     EXAMPLE
  1823.  
  1824.     NOTES
  1825.         Yes, I know the function *should* be called SaveBuffer...
  1826.         But for various convoluted and not entirely valid reasons,
  1827.         it's still called SaveBrush.
  1828.  
  1829.     BUGS
  1830.  
  1831.     SEE ALSO
  1832.  
  1833.  
  1834. scan.library/SaveMapped                               scan.library/SaveMapped
  1835.  
  1836.     NAME
  1837.         SaveMapped -- Save a colormapped image to disk.
  1838.  
  1839.     SYNOPSIS
  1840.         success = SaveMapped ( filename, format, image, args );
  1841.         D0.L                   A0        A1      A2     A3
  1842.  
  1843.         BOOL SaveMapped ( char *filenae, char *format,
  1844.                           struct MappedImage *image, char *args );
  1845.  
  1846.     FUNCTION
  1847.         Save a colormapped (eg. bitmap) image to disk using a
  1848.         specified file format.  This is used to save rendered
  1849.         images.
  1850.  
  1851.     INPUTS
  1852.         filename -- name of file to save to.
  1853.  
  1854.         format -- file format name (eg. "ILBM", "ANIM", etc.).
  1855.  
  1856.         image -- pointer to a valid MappedImage structure.  The
  1857.             following fields should be filled in:
  1858.  
  1859.                 Width           width of image in pixels.
  1860.  
  1861.                 Height          height of image in pixels.
  1862.  
  1863.                 BitMap          pointer to image's BitMap (the bitmap need
  1864.                                 not be in chip RAM).
  1865.  
  1866.                 Palette.Depth   depth of image (same as BitMap->Depth)
  1867.  
  1868.                 Palette.Count   count of colors used in the image
  1869.                                 (usually a power of two, but not required).
  1870.  
  1871.                 Palette.Table   pointer to RGB triplets of palette data.
  1872.  
  1873.                 Modes           viewmode of the image (if known).
  1874.  
  1875.                 AspectX,AspectY horizontal and vertical aspect
  1876.                                 ratio of the image.
  1877.  
  1878.         args -- argument string to be passed to the saver module
  1879.             that is called.
  1880.  
  1881.     RESULTS
  1882.         success -- TRUE if the save was successful, or FALSE if something
  1883.             went wrong.
  1884.  
  1885.     EXAMPLE
  1886.  
  1887.     NOTES
  1888.         Note the argument order is NOT the same as SaveBrush.
  1889.  
  1890.     BUGS
  1891.  
  1892.     SEE ALSO
  1893.         scan/loadsave.h
  1894.  
  1895.  
  1896. scan.library/SaveUndo                                   scan.library/SaveUndo
  1897.  
  1898.     NAME
  1899.         SaveUndo -- Save an area of a buffer to the undo buffer.
  1900.  
  1901.     SYNOPSIS
  1902.         continue = SaveUndo ( buffer, left, top, width, height );
  1903.         D0.L                  A0      D0.W  D1.W D2.W   D3.W
  1904.  
  1905.         BOOL SaveUndo ( struct Buffer *, short, short, short, short );
  1906.  
  1907.     FUNCTION
  1908.         Stores a copy of the selected area of the buffer in the undo buffer.
  1909.         The previous contents of the undo buffer are lost.  Only enough memory
  1910.         to hold the requested area is allocated for the undo buffer, to keep
  1911.         memory useage to a minimum.
  1912.  
  1913.         Always use this function if you are about to permanently alter
  1914.         ImageFX's main buffer, to give the user a chance to change his mind.
  1915.  
  1916.     INPUTS
  1917.         buffer -- pointer to Buffer from which to save the data.  This will
  1918.             usually be either the main buffer or a brush.
  1919.  
  1920.         left, top -- upper left pixel coordinate of the area to save, starting
  1921.             from 0,0 at the upper left of the image.
  1922.  
  1923.         width, height -- pixel size of the area to save.
  1924.  
  1925.     RESULTS
  1926.         continue -- if there is not enough memory to save an undo buffer, the
  1927.             user will be asked if he would like to continue without one.  The
  1928.             results of that request are returned here.  TRUE means either
  1929.             there was enough memory or the user wants to continue, FALSE means
  1930.             the operation should be terminated.
  1931.  
  1932.     EXAMPLE
  1933.         if (buf = ObtainBuffer(0)) {
  1934.             if (SaveUndo(buf, 0, 0, buf->Width, buf->Height)) {
  1935.                 /* do something to entire image */
  1936.             }
  1937.             ReleaseBuffer(buf);
  1938.         }
  1939.  
  1940.     NOTES
  1941.  
  1942.     BUGS
  1943.  
  1944.     SEE ALSO
  1945.  
  1946.  
  1947. scan.library/SetError
  1948.  
  1949.     NAME
  1950.         SetError - Set secondary error code.
  1951.  
  1952.     SYNOPSIS
  1953.         SetError ( errorcode )
  1954.                    D0.L
  1955.  
  1956.         void SetError ( ULONG );
  1957.  
  1958.     FUNCTION
  1959.         Sets the secondary error code upon failure.  Normally, functions
  1960.         simply return a TRUE or FALSE for success or failure.  On
  1961.         failure, a person can look to the secondary error code to
  1962.         find more information about why a particular function failed.
  1963.         This presumes that the failing function puts some meaningful
  1964.         information in the secondary error code.
  1965.  
  1966.     INPUTS
  1967.         errorcode -- A code describing an error condition.  Use the codes
  1968.             defined in "scan/errors.h".  The ERR_UserCancel code will
  1969.             not generate a requester on failure, all others will.
  1970.  
  1971.     RESULT
  1972.         None.
  1973.  
  1974.     EXAMPLE
  1975.  
  1976.     NOTES
  1977.  
  1978.     BUGS
  1979.  
  1980.     SEE ALSO
  1981.         scan/errors.h
  1982.  
  1983.  
  1984. scan.library/ShowPanel                                 scan.library/ShowPanel
  1985.  
  1986.     NAME
  1987.         ShowPanel -- Bring the the menu screen to the front.
  1988.  
  1989.     SYNOPSIS
  1990.         ShowPanel ()
  1991.  
  1992.         void ShowPanel ( void );
  1993.  
  1994.     FUNCTION
  1995.         Bring the menu screen ("panel") to the front, if it is not already
  1996.         visible.  You should always use this function instead of
  1997.         ScreenToFront(pScreen) so that the palette screen is handled properly.
  1998.  
  1999.     INPUTS
  2000.  
  2001.     RESULTS
  2002.  
  2003.     EXAMPLE
  2004.  
  2005.     NOTES
  2006.  
  2007.     BUGS
  2008.  
  2009.     SEE ALSO
  2010.         scan.library/HidePanel,scan.library/TogglePanel
  2011.  
  2012.  
  2013. scan.library/ShowStatus
  2014.  
  2015.     NAME
  2016.         ShowStatus -- display buffer information on ImageFX menu.
  2017.  
  2018.     SYNOPSIS
  2019.         ShowStatus ( buffer )
  2020.                      A0
  2021.  
  2022.         void ShowStatus ( struct Buffer * )
  2023.  
  2024.     FUNCTION
  2025.         Updates the Image Scan information display (which shows
  2026.         the name of the current image and its width and height),
  2027.         updates the mode indicators and the channel gadgets.
  2028.  
  2029.     INPUTS
  2030.         buffer -- The buffer from which to get all the information
  2031.             to display.  If NULL, then the current main buffer information
  2032.             will be used.
  2033.  
  2034.     RESULT
  2035.         None.
  2036.  
  2037.     EXAMPLE
  2038.  
  2039.     NOTES
  2040.         The main purpose for this is for Loaders to display the
  2041.         width/height/etc. of the file they are loading while
  2042.         decoding the file, so the user knows what he is loading.
  2043.  
  2044.     BUGS
  2045.  
  2046.     SEE ALSO
  2047.  
  2048.  
  2049. scan.library/StringRequest                         scan.library/StringRequest
  2050.  
  2051.     NAME
  2052.         StringRequest -- Present a string gadget requester to the user.
  2053.  
  2054.     SYNOPSIS
  2055.         result = StringRequest ( title, initial );
  2056.         D0.L                     A0     A1
  2057.  
  2058.         char *StringRequest ( char *, char * );
  2059.  
  2060.     FUNCTION
  2061.         Displays a string gadget requester where the user may enter a text
  2062.         string.  The function does not return until the user enters a string
  2063.         or cancels.
  2064.  
  2065.     INPUTS
  2066.         title -- Title for the requester.
  2067.  
  2068.         initial -- Initial contents of the string gadget, may be NULL.
  2069.  
  2070.     RESULTS
  2071.         result -- pointer to the string the user entered or NULL if the user
  2072.             cancels the requester.  You should make a copy of the string as
  2073.             soon as possible, because the next call to StringRequest() will
  2074.             destroy it.
  2075.  
  2076.     EXAMPLE
  2077.  
  2078.     NOTES
  2079.  
  2080.     BUGS
  2081.  
  2082.     SEE ALSO
  2083.  
  2084.  
  2085. scan.library/TogglePanel                             scan.library/TogglePanel
  2086.  
  2087.     NAME
  2088.         TogglePanel -- Toggle the visibility of the menu screen.
  2089.  
  2090.     SYNOPSIS
  2091.         TogglePanel ()
  2092.  
  2093.         void TogglePanel ( void );
  2094.  
  2095.     FUNCTION
  2096.         Toggles the menu screen ("panel") in front or back of the other
  2097.         screens.  This is what happens in response to a right mouse button
  2098.         click.
  2099.  
  2100.     INPUTS
  2101.         None.
  2102.  
  2103.     RESULTS
  2104.         None.
  2105.  
  2106.     EXAMPLE
  2107.  
  2108.     NOTES
  2109.  
  2110.     BUGS
  2111.  
  2112.     SEE ALSO
  2113.         scan.library/HidePanel,scan.library/ShowPanel
  2114.  
  2115.  
  2116. scan.library/VBoolRequest                           scan.library/VBoolRequest
  2117.  
  2118.     NAME
  2119.         VBoolRequest -- Present boolean Okay/Cancel requester to user.
  2120.         BoolRequest -- varargs stub to VBoolRequest.
  2121.  
  2122.     SYNOPSIS
  2123.         result = VBoolRequest ( title, arglist );
  2124.         D0.L                    A0     A1
  2125.  
  2126.         BOOL VBoolRequest ( char *, ULONG * );
  2127.  
  2128.         result = BoolRequest ( title, ... );
  2129.  
  2130.         BOOL BoolRequest ( char *, ... );
  2131.  
  2132.     FUNCTION
  2133.         Display a boolean Okay/Cancel requester to the user.  The function
  2134.         does not return until the user presses either the Okay or Cancel
  2135.         gadgets.
  2136.  
  2137.     INPUTS
  2138.         title -- Title of the requester.  Can contain printf-style formatting
  2139.             information.
  2140.  
  2141.         arglist -- pointer to list of arguments used to format the title
  2142.             string.
  2143.  
  2144.     RESULTS
  2145.         result -- TRUE if user selected Okay, FALSE if he selected Cancel.
  2146.  
  2147.     EXAMPLE
  2148.  
  2149.     NOTES
  2150.         BoolRequest() is defined in "scan.lib".
  2151.  
  2152.     BUGS
  2153.  
  2154.     SEE ALSO
  2155.  
  2156.  
  2157. scan.library/VErrorf
  2158.  
  2159.     NAME
  2160.         VErrorf -- Display generic error message to user.
  2161.         Errorf -- varargs stub to VErrorf().
  2162.  
  2163.     SYNOPSIS
  2164.         VErrorf ( controlstring, arglistptr )
  2165.                   A0             A1
  2166.  
  2167.         void VErrorf (char *, LONG * );
  2168.  
  2169.         Errorf ( controlstring, firstArg, ... );
  2170.  
  2171.         void Errorf ( char *, ... );
  2172.  
  2173.     FUNCTION
  2174.         Displays a bit of text to the user as an error message.  The
  2175.         function does not return until the user clicks the Okay
  2176.         gadget in the requester.
  2177.  
  2178.     INPUTS
  2179.         controlstring -- A printf()-style formatting string.
  2180.  
  2181.         arglistptr -- pointer to a longword array of arguments to be formatted
  2182.             for display.
  2183.  
  2184.     RESULT
  2185.         None.
  2186.  
  2187.     EXAMPLE
  2188.         Errorf ("Your %ls didn't work on attempt #%ld!",
  2189.                     bean_string, attempt_number);
  2190.  
  2191.     NOTES
  2192.         Errorf() is defined in "scan.lib".
  2193.  
  2194.     BUGS
  2195.  
  2196.     SEE ALSO
  2197.         scan.library/Error
  2198.  
  2199.  
  2200. scan.library/VInfoRequest                           scan.library/VInfoRequest
  2201.  
  2202.     NAME
  2203.         VInfoRequest -- Display informational requester.
  2204.         InfoRequest -- varargs stub to VInfoRequest.
  2205.  
  2206.     SYNOPSIS
  2207.         VInfoRequest ( controlstring, arglistptr )
  2208.                        A0             A1
  2209.  
  2210.         void VInfoRequest (char *, ULONG * );
  2211.  
  2212.         InfoRequest ( controlstring, firstArg, ... );
  2213.  
  2214.         void InfoRequest ( char *, ... );
  2215.  
  2216.  
  2217.     FUNCTION
  2218.         Display a simple 1-line informational requester.  The user must select
  2219.         the Okay gadget to proceed.
  2220.  
  2221.     INPUTS
  2222.         controlstring -- A printf()-style formatting string.
  2223.  
  2224.         arglistptr -- pointer to a longword array of arguments to be formatted
  2225.             for display.
  2226.  
  2227.     RESULTS
  2228.         None.
  2229.  
  2230.     EXAMPLE
  2231.  
  2232.     NOTES
  2233.         InfoRequest() is defined in "scan.lib".
  2234.  
  2235.     BUGS
  2236.  
  2237.     SEE ALSO
  2238.  
  2239.  
  2240. scan.library/zzzzzz
  2241.  
  2242. (That's so my autodoc-insertion macro works properly...)
  2243.